<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{{ provider }} Wi-Fi Monitoring</title>
    <meta name="author" content="Joey Freeland" />
    <link rel="stylesheet" type="text/css" href="http://www.google.com/css/maia.css">
    <link rel="stylesheet" type="text/css" href="/css/dashboard.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript" src="/js/jquery.dataTables.min.js"></script>
  </head>
  <body>
    <header id="maia-header">
      <h1>Wireless Usability Monitor</h1>
      <h2>{{ provider }}</h2>
    </header>
    <div id="tableview">
      <table id="dashboard">
        <thead>
          <tr>
            <td>Provider</td>
            <td>Location</td>
            <td>Link</td>
          </tr>
        </thead>
        <tbody>
        {% for provider,locations in results.items %}
          {% for location in locations.keys %}
          <tr>
            <td>{{ provider }}</td>
            <td>{{ location }}</td>
            <td>
              <a href="/csv/{{ provider }}/{{ location }}.csv">
                Download CSV
              </a>
            </td>
          </tr>
          {% endfor %}
        {% endfor %}
        </tbody>
      </table>
    </div>
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    // If you use Google Analytics, put your identifier and domain name here.
    ga('create', 'IDENTIFIER', 'DOMAIN');
    ga('send', 'pageview');
    </script>
    <script>
      $(document).ready(function() {
        $('#dashboard').dataTable( {
          "aaSorting": [[ 4, "desc" ]],
          "sDom": 't',
          "bAutoWidth": false,
          "iDisplayLength": 1000
        } );
      } ); 
    </script>
  </body>
</html>
